<template>
	<view class="order-settlement">
		<!-- 会员信息区域 -->
		<view class="member-info-box">
			<view class="member-info">
				<view style="padding-bottom: 20rpx;">会员名称：小小少年</view>
				<view>会员手机：15689420568</view>
			</view>
		</view>

		<!-- 课程信息 -->
		<view class="course-info-box">
			<view class="course-info">
				<view class="ci-left">
					幼儿英语入门
				</view>
				<view class="ci-right">
					<view><text class="cr-top">幼儿英语入门课程</text></view>
					<view><text class="cr-bottom">￥2999.00</text></view>
				</view>
			</view>
		</view>

		<!-- 优惠信息 -->
		<view class="discount-info">
			<view class="dt-left" @click="toggle('bottom')">
				<text style="font-size: 29rpx;color: #9c9ca0;">优惠券</text>
				<view style="vertical-align: middle;"><text style="font-size: 26rpx;margin-right: 20rpx;">已选一张；优惠50元
					</text><img class="arrow"
						src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/u2969.png"
						alt=""></view>
			</view>
			<view class="dt-right" @click="toggle1('bottom')">
				<text style="font-size: 29rpx;color: #9c9ca0;">积分抵扣</text>
				<view style="vertical-align: middle;"><text style="font-size: 26rpx;margin-right: 20rpx;">使用积分抵扣100元
					</text><img class="arrow"
						src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/u2969.png"
						alt=""></view>
			</view>
		</view>

		<!-- 合计信息 -->
		<view class="total-info">
			<view class="ti-one">
				<text style="font-size: 29rpx;color: #9c9ca0;">合计</text>
				<view style="vertical-align: middle;"><text style="font-size: 26rpx;margin-right: 20rpx;">2399.0</text>
				</view>
			</view>
			<view class="ti-one">
				<text style="font-size: 29rpx;color: #9c9ca0;">优惠券</text>
				<view style="vertical-align: middle;"><text style="font-size: 26rpx;margin-right: 20rpx;">-100</text>
				</view>
			</view>
			<view class="ti-one">
				<text style="font-size: 29rpx;color: #9c9ca0;">积分</text>
				<view style="vertical-align: middle;"><text style="font-size: 26rpx;margin-right: 20rpx;">-100</text>
				</view>
			</view>
			<view class="ti-one">
				<text style="font-size: 29rpx;color: #9c9ca0;">实付</text>
				<view style="vertical-align: middle;"><text
						style="font-size: 26rpx;margin-right: 20rpx;font-weight: bold;">￥2199.0</text></view>
			</view>
			<view class="ti-two">
				<view style="font-size: 26rpx;">本单可获得110积分</view>
			</view>
		</view>

		<!-- 底部支付信息 -->
		<view class="bottom-box">
			<view class="bottom">
				<view class="b-left">
					<text>￥2199</text>
				</view>
				<navigator class="b-right" url="/pages/paySuccess/paySuccess">
					<text>立即支付</text>
				</navigator>
			</view>
		</view>

		<!-- 优惠券弹框 -->
		<uni-popup ref="popup" background-color="#fff">
			<view class="discount-open">
				<view class="do-top">
					<view>可用优惠券</view>
					<view @click="close"><img style="width: 32rpx;height: 32rpx;"
							src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/u3008.png"
							alt=""></view>
				</view>
				<view class="do-middle">
					<view class="discount-show">
						<view class="ds-left">
							￥50
						</view>
						<view class="ds-right">
							<view><text style="font-size: 28rpx;color: #93989d;font-weight: bold;">购买课程无门槛优惠券</text>
							</view>
							<view><text style="color: #d1d3d4;font-size: 24rpx;">推荐好友购买获得</text></view>
							<view><text style="color: #d1d3d4;font-size: 24rpx;">有效期至：2019-08-01</text></view>
						</view>
						<view class="ds-circle">
							<img style="width: 40rpx;height: 40rpx;"
								src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/2_u3033.png"
								alt="">
						</view>
					</view>
				</view>
				<view class="do-bottom">
					<view class="db-left">
						<text>不使用优惠券</text>
					</view>
					<view class="db-right">
						<img style="width: 40rpx;height: 40rpx;"
							src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/1_u3032.png"
							alt="">
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 积分弹框 -->
		<uni-popup ref="points" background-color="#fff">
			<view class="points-open">
				<view class="do-top">
					<view>可用优惠券</view>
					<view @click="close1"><img style="width: 32rpx;height: 32rpx;"
							src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/u3008.png"
							alt=""></view>
				</view>
				<view class="do-bottom">
					<view class="db-left">
						使用积分抵扣100元
					</view>
					<view class="ds-circle">
						<img style="width: 40rpx;height: 40rpx;"
							src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/2_u3033.png"
							alt="">
					</view>
				</view>
				<view class="do-bottom">
					<view class="db-left">
						<text>不使用积分</text>
					</view>
					<view class="db-right">
						<img style="width: 40rpx;height: 40rpx;"
							src="https://cimg.axureshop.com/47/f6/19/47f6193bc5004b1388c6fa23d2a9bd4e/images/%E8%AE%A2%E5%8D%95%E7%BB%93%E7%AE%97/1_u3032.png"
							alt="">
					</view>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			toggle(type) {
				this.type = type
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.popup.open(type)
			},
			toggle1(type) {
				this.type = type
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.points.open(type)
			},
			close() {
				this.$refs.popup.close()
			},
			close1() {
				this.$refs.points.close()
			}
		}
	}
</script>

<style lang="less" scoped>
	// 会员信息
	.member-info-box {
		width: 750rpx;
		height: 200rpx;
		// background-color: red;
		display: flex;
		justify-content: center;
		align-items: center;

		.member-info {
			width: 676rpx;
			height: 158rpx;
			// background-color: blue;
			display: flex;
			flex-direction: column;
			justify-content: center;
			box-shadow: 1px 1px 20px 1px #f3dcff;
			font-size: 30rpx;
			border-radius: 10rpx;
			padding-left: 30rpx;


		}
	}

	// 课程信息
	.course-info-box {
		width: 750rpx;
		height: 250rpx;
		display: flex;
		justify-content: center;
		align-items: center;

		.course-info {
			width: 676rpx;
			height: 200rpx;
			box-shadow: 1px 1px 20px 1px #f3dcff;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			padding-left: 30rpx;
			border-radius: 10rpx;

			.ci-left {
				width: 174rpx;
				height: 128rpx;
				background-color: #cc66ff;
				font-size: 26rpx;
				color: white;
				border-radius: 20rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.ci-right {
				padding-left: 30rpx;
				height: 128rpx;
				width: 266rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: flex-start;

				.cr-top {
					font-size: 28rpx;
					font-weight: bold;
				}

				.cr-bottom {
					color: red;
					font-size: 28rpx;
					font-weight: bold;
				}
			}
		}
	}

	//优惠信息
	.discount-info {
		width: 750rpx - 60rpx;
		height: 200rpx;
		padding: 0 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		border-bottom: 2px solid #fcfcfc;
		// background-color: red;

		.dt-left {
			display: flex;
			justify-content: space-between;

			.arrow {
				width: 14rpx;
				height: 24rpx;
			}
		}

		.dt-right {
			display: flex;
			justify-content: space-between;

			.arrow {
				width: 14rpx;
				height: 24rpx;
			}
		}
	}

	//合计信息
	.total-info {
		width: 750rpx - 60rpx;
		height: 300rpx;
		padding: 0 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		padding-top: 20rpx;

		.ti-one {
			display: flex;
			justify-content: space-between;
		}

		.ti-two {
			display: flex;
			justify-content: flex-end;
			padding-right: 20rpx;
		}
	}

	//底部支付信息
	.bottom-box {
		height: 146rpx;

		.bottom {
			width: 750rpx;
			height: 146rpx;
			background-color: white;
			position: fixed;
			bottom: 0;
			border-top: 1px solid #f4f4f4;
			display: flex;
			justify-content: space-between;

			.b-left {
				width: 375rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				color: red;
				font-weight: bold;
				font-size: 38rpx;
			}

			.b-right {
				flex: 1;
				background-color: #2f78ff;
				display: flex;
				justify-content: center;
				align-items: center;
				color: white;
				font-size: 36rpx;
			}
		}
	}

	//优惠券的弹框
	.discount-open {
		width: 750rpx;
		height: 616rpx;
		// padding: 36rpx 42rpx;

		.do-top {
			height: 94rpx;
			border-bottom: 1px solid #fafafa;
			padding: 0 42rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 27rpx;
		}

		.do-middle {
			height: 300rpx;
			display: flex;
			justify-content: center;
			align-items: center;

			.discount-show {
				width: 656rpx;
				height: 192rpx;
				box-shadow: 2px 2px 20px 1px #f3f8ff;
				border: 1px solid #f1f3f6;
				border-radius: 10rpx;
				display: flex;

				.ds-left {
					width: 188rpx;
					height: 192rpx;
					background: linear-gradient(45deg, #6695FF 25%, #6639FF 75%);
					color: white;
					font-size: 70rpx;
					font-weight: bold;
					display: flex;
					justify-content: center;
					align-items: center;
				}

				.ds-right {
					display: flex;
					flex-direction: column;
					justify-content: space-around;
					padding-left: 20rpx;
				}

				.ds-circle {
					line-height: 192rpx;
					padding-left: 94rpx;
				}
			}
		}

		.do-bottom {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 50rpx;
			font-size: 29rpx;
		}
	}

	// 积分的弹框
	.points-open {
		height: 516rpx;

		.do-top {
			height: 94rpx;
			border-bottom: 1px solid #fafafa;
			padding: 0 42rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 27rpx;
		}

		.do-bottom {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 35rpx 50rpx;
			font-size: 29rpx;
		}
	}
</style>
